import {Injectable} from '@angular/core';
import 'rxjs/add/operator/toPromise';
import {SafeUrlPipe} from '../pipe/safeUrl.pipe';
import {Headers, Http, RequestOptions} from '@angular/http';
import { RouterModule, Routes } from '@angular/router';

@Injectable()
export class LoginsevService {

  // private burnsubUrl = 'http://192.168.9.123:3000/login';
  private burnsubUrl = 'http://192.168.9.141:3000/login';
  private host = 'http://192.168.9.123:3000/login';

  constructor(private http: Http) {
  }


  logindata(user, pwd) {
    //console.log('发送后台用户名密码，登录服务中的' + user + ':' + pwd);
    let headers = new Headers({'Content-Type': 'application/json'});
    let options = new RequestOptions({headers: headers});
    return this.http.post(this.burnsubUrl, {uid: user, upwd: pwd}, options).map(res=>{
      return res.json();
    })
  }



}
